
/*******************************************************************************
 * The code below this comment is integral part of the project "Jelliphy".
 * 
 * "Jelliphy" is a project created by: 
 * Dispage - Patrizio Gelosi
 * Via A. De Gasperi 91 
 * P. Potenza Picena (MC) - Italy
 * 
 * (Hereby referred to as "DISPAGE")
 * 
 * Copyright (c) 2011 DISPAGE.
 * 
 * @Released on: 02-06-2011
 * @Version: 1.0.00
 * @Build: 1109
 * @Site: http://www.dispage.com
 * @Contacts: http://www.dispage.com/contacts
 * 
 * The contents of this file are released under the GNU General Public License
 * version 3 as published by the Free Software Foundation that can be found at
 * the address "http://opensource.org/licenses/gpl-3.0.html". If the license
 * cannot be found, write to the Free Software Foundation, Inc., 51 Franklin
 * Street, Fifth Floor, Boston, MA 02110-1301 USA.
 * 
 * You may not use the present file except in compliance with the License.
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied.  See the License
 * for the specific language governing rights and limitations under the
 * License.
 * 
 * The interactive user interfaces in modified source and object code versions
 * of this program must display Appropriate Legal Notices, as required under
 * Section 5 of the GNU General Public License version 3.
 * 
 * In accordance with Section 7(b) of the GNU General Public License version 3,
 * these Appropriate Legal Notices must retain the display of the "Powered by
 * Dispage" logo. If the display of the logo is not reasonably feasible for
 * technical reasons, the Appropriate Legal Notices must display the words
 * "Powered by Dispage".
 * 
 ******************************************************************************/

JlQ.extend({

	preloadImages : function (imgList) {
		if (document.images) {
			JlQ.each(imgList, function () {
				preload_image = new Image();
				preload_image.src = this;
			});
		}
	},

	elementUnder : function (x, y, noScroll) {

		var $window = JlQ(window);

		return noScroll ? document.elementFromPoint(x, y) : document.elementFromPoint(x -$window.scrollLeft(), y -$window.scrollTop());
	},

	objectFilter : function(o, filter) {
		
		var f, i, r = {};

		for (i = 0; f = filter[i]; i++) {
			if (typeof o[f] != 'undefined') {
				r[f] = o[f];
			}
		}
		return r;
	},

	objKeys : function (o) {

		var res = [];
		
		JlQ.each(o, function(k) { res.push(k) });
		
		return res;
	},
		
	parseXML: function( data , xml , tmp ) {

		if ( window.DOMParser ) { // Standard
			tmp = new DOMParser();
			xml = tmp.parseFromString( data , "text/xml" );
		} else { // IE
			xml = new ActiveXObject( "Microsoft.XMLDOM" );
			xml.async = "false";
			xml.loadXML( data );
		}

		tmp = xml.documentElement;

		if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
			return JlQ.parseXML('<error>Error parsing xml</error>');
		}

		return xml;
	}

});
(function(JlQ) {
	JlQ.extend(JlQ.fn, {

		
		attrMgtitle: function (value) {

			return JlQ(this).attr('mgtitle', String(value).replace(/\s*!\s*important\s*/, ''));
		}
	});
})(JlQ);

JlQ.fn.reverse = [].reverse;
